package com.aplink.generic.pojo.controlspec;

import com.aplink.generic.util.AndroidUIParser;
import com.aplink.generic.util.objectrule.TargetRuleCollection;

public class ListviewSpec extends ControlSpec {
    private String mRowItem;
    private String mRptrdesign;
    private String mContentData;
    private TargetRuleCollection mTargetRuleCollection;
    private String selectWhere;

    public ListviewSpec( String rowItem, String rptrdesign,
                         String contentData, TargetRuleCollection targetRuleCollection,
                         String selectWhere ) {
        super();
        mRowItem = rowItem;
        mRptrdesign = rptrdesign;
        mContentData = contentData;
        mTargetRuleCollection = targetRuleCollection;
        this.selectWhere = selectWhere;
    }

    public String getContentData() {
        return mContentData;
    }

    public void setContentDatal( String contentData ) {
        mContentData = contentData;
    }

    public String getRowItem() {
        return mRowItem;
    }

    public void setRowItem( String rowItem ) {
        mRowItem = rowItem;
    }

    public String getRptrdesign() {
        return mRptrdesign;
    }

    public void setRptrdesign( String rptrdesign ) {
        mRptrdesign = rptrdesign;
    }

    public TargetRuleCollection getTargetRuleCollection() {
        return mTargetRuleCollection;
    }

    public void setTargetRuleCollection(
            TargetRuleCollection targetRuleCollection ) {
        mTargetRuleCollection = targetRuleCollection;
    }

    public String getSelectWhere() {
        return selectWhere;
    }

    public void setSelectWhere( String selectWhere ) {
        this.selectWhere = selectWhere;
    }

    public int getIdRptrDesign() {
        return AndroidUIParser.getRawIdByName( this.mRptrdesign );
    }

    public int getIdContentData() {
        return AndroidUIParser.getRawIdByName( this.mContentData );
    }

    public boolean hasSelectWhere() {
        if ( this.selectWhere == null ) {
            return false;
        }
        return true;
    }
}
